module components {
    //大厅工具条
    export class HallToolBarBtnPanel extends eui.Component {
        public img_btn: eui.Image;
        public img_bg: eui.Image;
        public lab_text: eui.Label;

        public constructor() {
            super();
            this.skinName = "resource/ui/qznn/HallToolBarBtnSkin.exml";
        }

        public childrenCreated(): void {
            super.childrenCreated();
            this.img_bg.touchEnabled = false;
            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.BeginClick, this);
            this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.ReleaseOutside, this);
            this.addEventListener(egret.TouchEvent.TOUCH_END, this.ReleaseOutside, this);
        }

        public BeginClick(event: egret.TouchEvent): void {
            this.img_btn.scaleX = 0.85;
            this.img_btn.scaleY = 0.85;
        }

        public ReleaseOutside(event: egret.TouchEvent): void {
            this.img_btn.scaleX = 1;
            this.img_btn.scaleY = 1;
        }

        //下注效果显示
        public GameUse(): void {
            this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.BeginClick, this);
            this.removeEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.ReleaseOutside, this);
            this.removeEventListener(egret.TouchEvent.TOUCH_END, this.ReleaseOutside, this);
            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.GameBeginClick, this);
            this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.GameReleaseOutside, this);
            this.addEventListener(egret.TouchEvent.TOUCH_END, this.GameReleaseOutside, this);
        }

        private GameBeginClick(event: egret.TouchEvent): void {
            this.lab_text.scaleX = 0.85;
            this.lab_text.scaleY = 0.85;
            this.img_btn.scaleX = 0.85;
            this.img_btn.scaleY = 0.85;
        }

        private GameReleaseOutside(event: egret.TouchEvent): void {
            this.lab_text.scaleX = 1;
            this.lab_text.scaleY = 1;
            this.img_btn.scaleX = 1;
            this.img_btn.scaleY = 1;
        }

        //游戏抢庄
        public GameQiangUse(): void {
            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.BeginClick, this);
            this.addEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.ReleaseOutside, this);
            this.addEventListener(egret.TouchEvent.TOUCH_END, this.ReleaseOutside, this);
            this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.GameBeginClick, this);
            this.removeEventListener(egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, this.GameReleaseOutside, this);
            this.removeEventListener(egret.TouchEvent.TOUCH_END, this.GameReleaseOutside, this);
        }
    }
}